{% extends "stg_detail.html" %}

{% block details %}

{% if object.description %}
    {{ object.description|linebreaks }}
{% endif %}

{% if file_types %}
    <h2>File type definitions for this DataSource</h2>
    <ul>
    {% for ft in file_types %}
        <li>FileType {{ ft.id }}
            <ul>
                <li>Content: {{ ft.get_content_type_display }}</li>
                <li>Compression: {{ ft.get_compression_display }}</li>
                <li>Regex pattern: "{{ ft.pattern }}"</li>
            </ul>
        </li>
    {% endfor %}
    </ul>
{% endif %}


<h2>Known files belonging to this DataSource</h2>
{% if files.content|length > 0 or files.load|length > 0 %}

    {% if files.content %}
        <h3>Content (data) files ({{ files.content|length }})</h3>
        <ul>
        {% for f in files.content %}
            <li><a href="{{ f.get_absolute_url }}">{{ f }}</a></li>
        {% endfor %}
        </ul>
    {% endif %}


    {% if files.load %}
        <h3>Loading program (meta) files ({{ files.load|length }})</h3>
        <ul>
        {% for f in files.load %}
            <li><a href="{{ f.get_absolute_url }}">{{ f }}</a></li>
        {% endfor %}
        </ul>
    {% endif %}

{% else %}
<p>No known files belong to this DataSource</p>
{% endif %}


{% endblock %}
